package xyz.szy.demo.router;

import lombok.extern.slf4j.Slf4j;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class CustomRouter extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("paho:from/queue")
                .to("paho:to/queue")
                .to("kafka:topic_szy")
                .process(exchange -> {
                    exchange.getMessage().setBody("to queue 1");
                })
                .to("paho:to/queue1");
    }
}
